Merged
Conversation
Major refactoring to reduce code duplication and address security concerns: * feat(__api_request): consolidate retry logic into _request_with_retry - Extract HTTP operations into inner functions (_do_get, _do_post, etc.) - Centralize error handling for all HTTP methods - Reduces code duplication by ~55 lines * security(__api_session): remove SSL verification bypass in Vault client - Remove verify=False from hvac.Client initialization - Make vault attributes private (_vault_url, _vault_path, etc.) - Improve vault credentials cleanup in finally block * feat(__api_session): improve session management - Add _new_session() helper for consistent session initialization - Add validate parameter to set_api_token() for optional token validation - Fix delete_api_token() to return APIResponse instead of Response - Use mist_delete() method instead of raw session.delete() * perf(__init__): implement lazy loading for heavy subpackages - Defer api and cli imports until accessed - Improves initial import performance * fix(__logger): correct logging sanitization - Use getMessage() instead of direct msg access - Clear record.args after sanitization to prevent re-formatting This refactoring improves maintainability, security, and performance without changing the public API surface.
refactor: rename utils to device_utils and adopt camelCase public API Reorganize device utility modules from `mistapi.utils` to `mistapi.device_utils` with a clean separation between internal implementations (`__tools/`) and public-facing device modules (ap, ex, srx, ssr). Public function names now use camelCase (e.g. retrieveArpTable, monitorTraffic) for consistency with the auto-generated REST API. Also adds comprehensive unit tests for api_request, api_response, api_session, models, pagination, logger, init, and websocket_client.
- Updated `searchOrgNacClients` and `searchSiteNacClients` to correct status options from 'session_ended' to 'session_stopped'. - Rearranged parameters in `searchOrgWanClients`, `searchSiteWanClients`, and `searchSiteWirelessClients` for consistency and clarity. - Added new parameters `cert_expiry_duration` and `psk_name` to `searchSiteNacClients` and `searchSiteWirelessClients` respectively. - Removed unused parameters and cleaned up query parameter handling in various search functions. - Enhanced logging and sanitization in `test_logger.py` to ensure sensitive data is properly redacted. - Deleted obsolete test file `test.py` to streamline the test suite. - Improved test readability and structure across multiple test files.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.